<template>
  <div>
    <ul>
      <li @click="urlFn(1)">姜子牙</li>
      <li @click="urlFn(2)">八佰</li>
      <li @click="urlFn(3)">红海行动</li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  mounted() {},
  methods: {
    urlFn(id) {
      // this.$router.push({ path: `/detail/${id}`,query:{uid:10000,name:'zhangsan'} });
      // 命名路由 使用路由规则中的名称来定义路由跳转
      this.$router.push({ name: "detail", params: { id } });
      // this.$router.push({ name: "bb" });
    },
  },
};
</script>

<style scoped>
</style>
